package com.chentongwei.controller.common;

import com.alibaba.dubbo.config.annotation.Reference;
import com.chentongwei.facade.tucao.service.IInitCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;

/**
 * 初始化数据的控制器
 * 容器启动时自动执行的方法，无需开发者手动调用。
 *
 * @author TongWei.Chen 2017-9-28 17:59:47
 */
@RestController
@RequestMapping("/common/initData")
public class InitDataController {

    @Autowired
    private IInitCatalogService iInitCatalogService;

    /**
     * 将分类名称放到redis的list中
     */
    @PostConstruct
    public void initCatalog() {
        iInitCatalogService.initCatalog();
    }

}
